<template>


  <div class="app-container">


    <el-card shadow="always" style="margin-top: 20px;">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"
    v-show="showSearch" label-width="160px">
    <el-row :gutter="20">
      <el-col :span="22">
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="指南文件" prop="guideFileName">
            <el-input
              v-model="queryParams.guideFileName"
              placeholder="请输入指南文件名"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item label="级别" prop="level">
            <el-select v-model="queryParams.level" placeholder="请选择级别" clearable>
              <el-option
                v-for="dict in dict.type.sci_pjt_leavel"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item label="指南类别" prop="guideCategory">
            <el-select v-model="queryParams.guideCategory" placeholder="请选择指南类别" clearable>
              <el-option
                v-for="dict in dict.type.sci_guide_category"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item label="归口部门" prop="responsibleDepartment">
            <el-input
              v-model="queryParams.responsibleDepartment"
              placeholder="请输入归口部门"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>



        </el-col>
        <el-col :span="24">
          <el-form-item label="发布时间">
            <el-date-picker
              v-model="daterangePublishTime"
              style="width: 208px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>

          <el-form-item label="申报期限">
            <el-date-picker
              v-model="daterangeApplicationDeadline"
              style="width: 208px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>

        </el-col>
      </el-row>
      </el-col>

      <!-- 第二列 -->
      <el-col :span="2">
        <el-row>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        </el-form-item>
      </el-row>
      <el-row>
        <el-form-item>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-row>
      </el-col>
      </el-row>
    </el-form>
    </el-card>
    <el-card shadow="always" style="margin-top: 20px;">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:appPublish:add']"
        >新增</el-button>
      </el-col>

      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:appPublish:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:appPublish:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="publishList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="指南文件名" align="center" prop="guideFileName" />
      <el-table-column label="级别" align="center" prop="level">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sci_pjt_leavel" :value="scope.row.level"/>
        </template>
      </el-table-column>
      <el-table-column label="指南类别" align="center" prop="guideCategory">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sci_guide_category" :value="scope.row.guideCategory"/>
        </template>
      </el-table-column>
      <el-table-column label="归口部门" align="center" prop="responsibleDepartment" />
      <el-table-column label="申报期限" align="center" prop="applicationDeadline" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.applicationDeadline, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="发布人" align="center" prop="publisher" />
      <el-table-column label="发布时间" align="center" prop="publishTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <!-- <el-table-column label="状态" align="center" prop="status" /> -->
      <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.status === 1" type="success">申报中</el-tag>
          <el-tag v-else type="danger">已关闭</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="操作"  width="250" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
            <el-button
               type="text"
              style="color: #409EFF;"

              @click="handleView(scope.row)"
              v-hasPermi="['system:appPublish:query']"
            >查看</el-button>
            <el-button
              type="text"
              style="color: #E6A23C;"

              @click="handleUpdate(scope.row)"
              v-hasPermi="['system:appPublish:edit']"
            >修改</el-button>

            <el-button
             type="text"
            :style="{ color: scope.row.status ===1  ? '#F56C6C' : '#67C23A' }"
              @click="scope.row.status ===1 ? handleClose(scope.row) : handleOpen(scope.row)"
              v-hasPermi="['system:appPublish:close']"
            >
              {{ scope.row.status ===1 ? '关闭' : '开放' }}
            </el-button>

            <el-button
               type="text"
              style="color: #909399;"
              @click="handleUpdateAnn(scope.row)"
              v-hasPermi="['system:appPublish:gs']"
            >公示</el-button>

            <el-button
               type="text"
              style="color: #409EFF;"
              @click="handleFill(scope.row)"
              v-hasPermi="['system:appPublish:fill']"
              :disabled="scope.row.status !== 1"
            >
              {{ scope.row.status === 1 ? '填报' : '已截止' }}
            </el-button>
          </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

  </el-card>

    <!-- 添加或修改项目征集发布对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
      <el-card shadow="always" style="margin-top: 20px;">
        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
              <el-row :gutter="20">
                <el-divider ><i class="el-icon-collection"></i>  基本信息</el-divider>

                <el-col :span="12">
                  <el-form-item label="指南文件名" prop="guideFileName">
                    <el-input v-model="form.guideFileName" placeholder="请输入指南文件名" clearable :style="{width: '100%'}"/>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="归口部门" prop="responsibleDepartment">
                    <el-input v-model="form.responsibleDepartment" placeholder="请输入归口部门" clearable :style="{width: '100%'}"/>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="级别" prop="level">
                    <el-radio-group v-model="form.level" size="medium">
                      <el-radio
                        v-for="(item, index) in dict.type.sci_pjt_leavel"
                        :key="index"
                        :label="item.value"
                        :disabled="item.disabled">{{item.label}}</el-radio>
                    </el-radio-group>

                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="指南类别" prop="guideCategory">
                    <el-radio-group v-model="form.guideCategory" size="medium">
                      <el-radio
                        v-for="(item, index) in dict.type.sci_guide_category"
                        :key="index"
                        :label="item.value"
                        :disabled="item.disabled">{{item.label}}</el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>

                <el-col :span="8">
                  <el-form-item label="申报期限" prop="applicationDeadline" >
                    <el-date-picker clearable
                      v-model="form.applicationDeadline"
                      type="date"
                      :style="{width: '100%'}"
                      value-format="yyyy-MM-dd"
                      placeholder="请选择申报期限">
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="发布人" prop="publisher">
                    <el-input v-model="form.publisher" placeholder="请输入发布人" />
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="发布时间" prop="publishTime" >
                    <el-date-picker clearable
                      v-model="form.publishTime"
                      type="date"
                      value-format="yyyy-MM-dd"
                      :style="{width: '100%'}"
                      placeholder="请选择发布时间"
                      >
                    </el-date-picker>
                  </el-form-item>
                </el-col>


            </el-row>

            <el-divider ><i class="el-icon-folder-opened"></i>  附件文档</el-divider>
            <file-upload-table v-model="form.fileRows" :show-add="true" />
      </el-form>
    </el-card>
      <div slot="footer" class="dialog-footer">
        <el-button type="success" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>



    <!-- 公示信息对话框 -->
    <el-dialog :title="title" :visible.sync="openAnn" width="40%" append-to-body>
      <el-card shadow="always" >
        <el-form ref="formAnnouncement" :model="formAnnouncement" :rules="rules" label-width="100px">

            <el-divider ><i class="el-icon-folder-opened"></i>  公示文档</el-divider>
            <el-row v-for="(row, index) in formAnnouncement.fileRows" :key="row.id || index">
              <el-col :span="24">
                <el-form-item label="文件名称" :prop="'fileRows.' + index + '.fileClassName'" :rules="rules.fileRows.fileClassName" >

                  <el-input  v-model="row.fileClassName" placeholder="请输入文件名" clearable :style="{width: '100%'}"></el-input>
                </el-form-item>
              </el-col>

              <el-col :span="24">
                <el-form-item label="附件" :prop="'fileRows.' + index + '.fileInfo'" :rules="rules.fileRows.fileInfo" required>
                  <file-upload v-model="row.fileInfo"
                  @update:datetime="handleDatetimeUpdateAnn(index, $event)"/>
                </el-form-item>
              </el-col>

            </el-row>

      </el-form>
    </el-card>
      <div slot="footer" class="dialog-footer">
        <el-button type="success" @click="submitFormAnn">确 定</el-button>
        <el-button @click="cancelAnn">取 消</el-button>
      </div>
    </el-dialog>



    <el-drawer
      title="项目指南发布信息"
      :visible.sync="drawer"
      size="50%">

      <el-card shadow="always" style="margin: 20px;">
        <el-descriptions title="基本信息"  border  :column="2">
          <el-descriptions-item label="指南文件名"  > {{this.formView.guideFileName}}</el-descriptions-item>
          <el-descriptions-item label="归口部门">{{ formView.responsibleDepartment }}</el-descriptions-item>
          <el-descriptions-item label="级别">
            <dict-tag :options="dict.type.sci_pjt_leavel" :value="formView.level"/>
          </el-descriptions-item>
          <el-descriptions-item label="指南类别"  >
            <dict-tag :options="dict.type.sci_guide_category" :value="formView.guideCategory"/>
          </el-descriptions-item>
          <el-descriptions-item label="申报期限">{{ formView.applicationDeadline }}</el-descriptions-item>
          <el-descriptions-item label="申报状态">
            <el-tag v-if="formView.status === 1" type="success">申报中</el-tag>
            <el-tag v-else type="danger">已关闭</el-tag>
          </el-descriptions-item>
          <el-descriptions-item label="发布人">
            {{this.formView.publisher}}
          </el-descriptions-item>
          <el-descriptions-item label="发布时间">
            {{this.formView.publishTime}}
          </el-descriptions-item>

        </el-descriptions>
      </el-card>
      <el-card shadow="always" style="margin: 20px;">
        <el-descriptions title="附件文档" :column="1" border>
          <el-descriptions-item v-for="(row, index) in formView.fileRows" :key="'file-' + index" :label="row.fileClassName || '未命名文件'">
            <div>
              <p>
                <template v-if="row.fileInfo && row.fileInfo.length > 0">
                  <div v-for="(file, fileIndex) in row.fileInfo" :key="fileIndex" style="margin-top: 5px;">
                    <el-link
                      type="primary"
                      target="_blank"
                       @click="handleDownload(file)"
                    >
                      {{ file.originalName }}
                    </el-link>

                    <span style="margin-left: 8px; color: #909399; font-size: 12px">
                      ({{ (file.fileSize/1024).toFixed(2) }} KB)
                    </span>
                  </div>
                </template>
                <span v-else style="color: #909399">无附件</span>
              </p>
              <p>上传人: {{ row.uploader }}</p>
              <p>上传时间: {{ row.uploadTime }}</p>

            </div>
          </el-descriptions-item>
        </el-descriptions>
      </el-card>
    </el-drawer>


  </div>
</template>

<script>
import { listPublish, getPublish, delPublish, addPublish, updatePublish,updatePublishAnn } from "@/api/sci/appPublish";
import { downloadMinioFile } from '@/api/common/common';
import FileUploadTable from '@/views/sci/components/FileUploadTable';



export default {
  name: "AppPublish",
  dicts: ['sci_guide_category', 'sci_pjt_leavel'],
  components: {
    FileUploadTable
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 项目征集发布表格数据
      publishList: [],

      // 征集申报数据
      sciProjectApplicationSubmitList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,

      openAnn: false,

      drawer: false,

      // 状态时间范围
      daterangeApplicationDeadline: [],
      // 状态时间范围
      daterangePublishTime: [],

      username : this.$store.state.user.nickName,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        guideFileName: null,
        level: null,
        guideCategory: null,
        responsibleDepartment: null,
        applicationDeadline: null,
        publisher: null,
        publishTime: null,
        status: null,
      },
      // 表单参数
      form: {
        fileRows: [
          {
            fileClassName: '',
            uploader: '',
            uploadTime: '',
            fileInfo: []
          }
        ]
      },
      formAnnouncement: {
        fileRows: [
          {
            fileClassName: '',
            uploader: '',
            uploadTime: '',
            fileInfo: []
          }
        ]
      },

      formView: {
        fileRows: [] // 初始化为空数组
      },
      // 表单校验
      rules: {
        guideFileName: [
          { required: true, message: "指南文件名不能为空", trigger: "blur" }
        ],
        level: [
          { required: true, message: "级别不能为空", trigger: "change" }
        ],
        guideCategory: [
          { required: true, message: "指南类别不能为空", trigger: "change" }
        ],
        responsibleDepartment: [
          { required: true, message: "归口部门不能为空", trigger: "blur" }
        ],
        applicationDeadline: [
          { required: true, message: "申报期限不能为空", trigger: "blur" }
        ],
        publisher: [
          { required: true, message: "发布人不能为空", trigger: "blur" }
        ],
        publishTime: [
          { required: true, message: "发布时间不能为空", trigger: "blur" }
        ],
        status: [
          { required: true, message: "状态不能为空", trigger: "change" }
        ],
        fileRows: {
          fileClassName: [
            { required: true, message: '请选择文件名称', trigger: 'change' }
          ],

          fileInfo: [
            { required: true, message: '请上传附件', trigger: 'change' }
          ],
        },
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询项目征集发布列表 */
    getList() {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeApplicationDeadline && '' != this.daterangeApplicationDeadline) {
        this.queryParams.params["beginApplicationDeadline"] = this.daterangeApplicationDeadline[0];
        this.queryParams.params["endApplicationDeadline"] = this.daterangeApplicationDeadline[1];
      }
      if (null != this.daterangePublishTime && '' != this.daterangePublishTime) {
        this.queryParams.params["beginPublishTime"] = this.daterangePublishTime[0];
        this.queryParams.params["endPublishTime"] = this.daterangePublishTime[1];
      }
      listPublish(this.queryParams).then(response => {
        this.publishList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    cancelAnn() {
      this.openAnn = false;
      this.resetAnn();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        guideFileName: null,
        level: null,
        guideCategory: null,
        responsibleDepartment: null,
        applicationDeadline: null,
        publisher: null,
        publishTime: null,
        status: null,
        createdBy: null,
        createdTime: null,
        updatedBy: null,
        updatedTime: null,
        fileRows: [  // 保持基础结构
          {
            fileClassName: '',
            uploader: '',
            uploadTime: '',
            fileInfo: []
          }
        ]
      };
      this.sciProjectApplicationSubmitList = [];
      this.resetForm("form");
    },

    resetAnn() {
      this.form = {
        id: null,
        guideFileName: null,
        level: null,
        guideCategory: null,
        responsibleDepartment: null,
        applicationDeadline: null,
        publisher: null,
        publishTime: null,
        status: null,
        createdBy: null,
        createdTime: null,
        updatedBy: null,
        updatedTime: null,
        fileRows: [  // 保持基础结构
          {
            fileClassName: '',
            uploader: '',
            uploadTime: '',
            fileInfo: []
          }
        ]
      };
      this.sciProjectApplicationSubmitList = [];
      this.resetForm("form");
    },

    resetView() {
      this.formView = {
        id: null,
        guideFileName: null,
        level: null,
        guideCategory: null,
        responsibleDepartment: null,
        applicationDeadline: null,
        publisher: null,
        publishTime: null,
        status: null,
        createdBy: null,
        createdTime: null,
        updatedBy: null,
        updatedTime: null,
        fileRows: [  // 保持基础结构
          {
            fileClassName: '',
            uploader: '',
            uploadTime: '',
            fileInfo: []
          }
        ]
      };
      this.resetForm("formView");
    },
    handleDatetimeUpdate(index, datetime) {
      // Update the corresponding uploadTime field
      this.$set(this.form.fileRows[index], 'uploadTime', datetime);
    },

    handleDatetimeUpdateAnn(index, datetime) {
      // Update the corresponding uploadTime field
      this.$set(this.formAnnouncement.fileRows[index], 'uploadTime', datetime);
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeApplicationDeadline = [];
      this.daterangePublishTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "项目征集发布";
      this.form.fileRows[0].uploader = this.username;
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getPublish(id).then(response => {
        this.form = response.data;
        this.sciProjectApplicationSubmitList = response.data.sciProjectApplicationSubmitList;
        this.open = true;
        this.title = "修改项目征集";
      });
    },
    handleUpdateAnn(row) {
      this.resetAnn();
      const id = row.id || this.ids
      getPublish(id).then(response => {
        this.formAnnouncement = response.data;
        this.formAnnouncement.fileRows=[
          {
            fileClassName: '公示文件',
            uploader:  this.username,
            uploadTime: '',
            fileInfo: []
          }
        ]
        this.openAnn = true;
        this.title = "公示信息";
      });
    },
    handleClose(row) {
      const ids = row.id || this.ids
      const guideFileName = row.guideFileName || this.guideFileName;
      this.$modal.confirm('是否确认关闭项目征集发布为"' + guideFileName + '"的数据项？').then(function() {
        return updatePublish({id:ids,status:0});
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("关闭成功");
      });
    },


    handleOpen(row) {
      const ids = row.id || this.ids
      const guideFileName = row.guideFileName || this.guideFileName;
      this.$modal.confirm('是否确认重新开放项目申报发布为"' + guideFileName + '"的数据项？').then(function() {
        return updatePublish({id:ids,status:1});
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("已重新开放");
      });
    },
    handleFill(row) {
      const ids = row.id || this.ids
      this.$router.push({
        name: 'AppSubmit',
        query: { id: ids }
      });
    },

    handleView(row) {
      this.resetView();
      const id = row.id || this.ids
      getPublish(id).then(response => {

        if (response.data && response.data.fileRows) {
          response.data.fileRows = response.data.fileRows.map(fileRow => {
            try {
              // 如果fileInfo是字符串则转换为数组，否则保持原样
              fileRow.fileInfo = typeof fileRow.fileInfo === 'string'
                ? JSON.parse(fileRow.fileInfo)
                : fileRow.fileInfo;
            } catch (e) {
              console.error('fileInfo解析失败：', e);
              fileRow.fileInfo = [];
            }
            return fileRow;
          });
        }
        this.formView = response.data;

        this.drawer = true;
      });
    },
    handleDownload(file) {
      const fileName = file.url; // 替换为实际的文件名
      downloadMinioFile(fileName);
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {

          if (!fileRows || fileRows.length === 0) {
            this.$message.error('请上传文件');
            return;
          }
          for (let i = 0; i < fileRows.length; i++) {
            const row = fileRows[i];
            if (!row.fileClassName || row.fileClassName.trim() === '') {
              this.$message.error(`第 ${i + 1} 行文件类型不能为空`);
              return;
            }

            if (!row.fileInfo || JSON.parse(row.fileInfo).length === 0) {
              this.$message.error(`第 ${i + 1} 行附件不能为空`);
              return;
            }
          }
          if (this.form.id != null) {
            updatePublish(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPublish(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },

    submitFormAnn() {
      this.$refs["formAnnouncement"].validate(valid => {
        if (valid) {
          if (this.formAnnouncement.id!= null) {
            updatePublishAnn(this.formAnnouncement).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.openAnn = false;
              this.getList();
            });
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除项目征集发布编号为"' + ids + '"的数据项？').then(function() {
        return delPublish(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/publish/export', {
        ...this.queryParams
      }, `publish_${new Date().getTime()}.xlsx`)
    },
    addRow() {
      this.form.fileRows.push({
        fileClassName: '',
        uploader: this.username,
        uploadTime: '',
        fileInfo: [],
      });
    },
    removeRow(index) {
      if (this.form.fileRows.length > 1) {
        this.form.fileRows.splice(index, 1);
      } else {
        this.$message.warning('至少需要保留一行');
      }
    },

    formatStatus(status) {
      return status === '1' || status === 1 ? '申报中' : '已关闭';
    }
  }
};
</script>
